package other.third.service;

import com.alibaba.fastjson2.JSON;
import other.third.entity.base.ThirdRequest;
import other.third.entity.base.Verify;

/**
 * @author 王霄
 * @date 2021/4/26
 */
public abstract class AbstractThirdClient implements ThirdClient {

    protected <T extends Verify> T post(ThirdRequest request, Class<T> resClass) {
        try {
            return JSON.parseObject(JSON.toJSONString(request), resClass);
        } catch (Throwable e) {
            return null;
        }
    }
}
